.\" -*- nroff -*-
.\"
.\" copyright (C) 1997 Stephen Williams <steve@icarus.com>
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.TH skel 9 "$Date:$" "Linux DDI" "VM Functions"
.\"
.\" Turn off hyphenation and right justification for the first sections.
.hlm 0
.na
.\" The name should be formatted this way for apropos to work
.SH NAME
MAP_NR \- get memory map index for page in kernel memory
.\"
.\"
.SH SYNOPSIS
.B #include <linux/mm.h>
.sp
.BI "#define MAP_NR(" page ")"
.HP
.\"
.\" Turn hyphenation and adjustment back on.
.hlm 1
.ad
.SH DESCRIPTION
This macro maps the page of kernel memory to an index into the
.B mem_map
array. The input page is kernel-space page addresses such as those
that come from the
.BR get_free_page "(9)"
function. The expression
.I "mem_map[MAP_NR(page)]"
returns a pointer to a
.I mem_map_t
for the page in question.
.PP
Device drivers need access to the page structure if it is implimenting
some special kind of memory segment, i.e. cache for a virtual frame buffer.
.SH "RETURN VALUE"
Returns an index into the
.B mem_map
array.
.SH AVAILABILITY
Linux 2.0+
.SH "SEE ALSO"
.hlm 0
.na
.BR get_free_pages "(9)"
.ad
.hlm 1
.PP
.I "/usr/include/asm/page.h"
.SH AUTHOR
Stephen Williams <steve@icarus.com>
.SH BUGS
There is no check that the page you are passing really is a valid page
address.
